<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-10-10 15:07:03
         compiled from "D:\WebApplication\myconpany\sumi_mobile\application\views\login\index.html" */ ?>
<?php /*%%SmartyHeaderCode:17935618b91759b865-58965654%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'beb2749e5cce6b2a861d4a8c4a9e47bba1eafc2f' => 
    array (
      0 => 'D:\\WebApplication\\myconpany\\sumi_mobile\\application\\views\\login\\index.html',
      1 => 1444271226,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '17935618b91759b865-58965654',
  'function' => 
  array (
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.21-dev',
  'unifunc' => 'content_5618b9177510d3_74319955',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_5618b9177510d3_74319955')) {function content_5618b9177510d3_74319955($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ((@constant('APPLICATION_PATH')).("/application/views/header.html"), $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>


<section class="wrap">

    <!--content stop-->

    <section class="login">
        <ul>
            <li><input class="login-text" type="text" name="username" placeholder="请输入用户名"/></li>
            <li><input class="login-text" type="password" name="password" placeholder="请输入密码"/></li>
            <li><input class="login-code" type="text" name="code" placeholder="输入验证码"/>
            <div class="code-pic"><img src="/login/code"  id="login_code_img" onclick="change_code()" width="100%" height="40"  /></div></li>
            <li><input class="login-btn" type="submit" value="登录"/></li>
            <li><a href="#" class="fl orange">免费注册</a><a href="#" class="fr">找回密码</a></li>
            <li>其他方式登录：</li>
            <li class="coo_panel">
                <ul>
                    <li><p class="btn_qq"></p></li>
                    <li><p class="btn_alipay"></p></li>
                    <li><p class="btn_weibo"></p></li>
                    <li><p class="btn_weixin"></p></li>
                </ul>
            </li>
        </ul>
    </section>

    <!--content end-->


</section>


<?php echo '<script'; ?>
>
    function change_code(){
        var img = document.getElementById('login_code_img');
        img.src = '/login/code/rand/' + Math.random();
    };

    $(function(){
        $(".login-btn").click(function(){
            var username =  $("input[name=username]").val();
            var password =  $("input[name=password]").val();
            var code =  $("input[name=code]").val();
            $.ajax({
                url:'/login/login',
                data:{username:username,password:password,code:code},
                type:'POST',
                success:function(data){
                    var data = eval("("+data+")");
                    var code = data.code;
                    var msg = data.msg;
                    if(code == 1004){
                        alert(data.msg);
                        change_code();
                        return;
                    }
                    if(code == 1008){
                        window.location.href = "/user";
                    }else{
                        alert(data.msg);
                        return;
                    }
                    return false;
                },
                dataType:'text'
            });
        });
    });
<?php echo '</script'; ?>
>

<?php echo $_smarty_tpl->getSubTemplate ((@constant('APPLICATION_PATH')).("/application/views/footer.html"), $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

<?php }} ?>
